/**
 * 
 * 
 * @class NG.command.GetLookupXml
 * @extends Ext.util.Observable
 */

NG.command.GetLookupXml = Ext.extend(NG.command.Request, {

	keyField: null,
	valueField: null,
	tableName: null,
	_in: "",
	_s: "",
	
	/**
	 * Used for obtaining xml data for<br>
	 * requesting keys/values according to given table
	 * 
	 * @return {String} formed xml structure
	 */
	getDataXML: function(){
    	var XML = new XMLWriter();
    	XML.BeginNode(NG.constants.GetLookupXml.XML_Params);
        	XML.Node(NG.constants.GetLookupXml.XML_KeyField, this.keyField);
        	XML.Node(NG.constants.GetLookupXml.XML_ValueField, this.valueField);
        	XML.Node(NG.constants.GetLookupXml.XML_TableName, this.tableName);
        	XML.Node(NG.constants.GetLookupXml.XML_ExtraSQL, "");
        	XML.Node(NG.constants.GetLookupXml.XML_OrderField, "");
    		XML.Node(NG.constants.GetLookupXml.XML_Params_In, this._in);	
        	XML.Node(NG.constants.GetLookupXml.XML_Params_S, this._s);
    	XML.EndNode();
    	XML.Close();
    	return XML.ToString();		
	},
	
	/**
	 * Each request class has a response <br>
	 * Response object can be obtained over related request object
	 * 
	 * @param {String} xmlData - unparsed response data according to request
	 * return {NG.response.GetLookupXML} response object related with request
	 */
	getResponse: function(xmlData){
		return new NG.response.GetLookupXML({
			xmlData: xmlData
		});	
	},
		
	constructor: function(config){
		config = config || {};
		config.serviceName = XSN_NETCAD_GETLOOKUPXML;
		config.showLoading = false;
		NG.command.GetLookupXml.superclass.constructor.call(this, config);
	}
	
});

NGGetLookupXml = NG.command.GetLookupXml;
